﻿<!DOCTYPE html>

<!--培训计划生成-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>
<body>
    
<div id="app" v-cloak>   
        <el-form label-position=" right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                 style="margin-bottom: 15px;">

            <p>年份：{{planYear}}</p>

            <el-col span="24">
                <el-table ref="table" stripe :data="ListItem.tableData" :row-key="getRowKeys" 
                         
                          border @selection-change="handleSelectionChange" row-style="height:10px"
                          style="width: 100%;">
                    <el-table-column type="selection" style="
                    padding-top: 0px;
                    padding-bottom: 0px;
                " align="center" width="55" :reserve-selection="true">
                    </el-table-column>
                    <el-table-column type="index" :label="col.SequenceNumber" :index="indexMethod" width="50"
                                     show-overflow-tooltip="true"></el-table-column>
                    <el-table-column prop="post" :label="TrainingPlanManagement.post" min-width="100"
                                     show-overflow-tooltip="true">
                    </el-table-column>
                    <el-table-column prop="trainingcourse" :label="TrainingPlanManagement.trainingcourse" min-width="200"
                                     show-overflow-tooltip="true">
                    </el-table-column>


                    <!--<el-table-column prop="yOrNTraining" :label="TrainingPlanManagement.yOrNTraining" min-width="80"
                         show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="HeadofTraining" :label="TrainingPlanManagement.HeadofTraining" min-width="100"
                         show-overflow-tooltip="true">
        </el-table-column>

        <el-table-column prop="Trainingbudget" :label="TrainingPlanManagement.Trainingbudget" min-width="80"
                         show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="Trainingtime" :label="TrainingPlanManagement.Trainingtime" min-width="100"
                         show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="Trainingvenues" :label="TrainingPlanManagement.Trainingvenues" min-width="100"
                         show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="Trainer" :label="TrainingPlanManagement.Trainer" min-width="80"
                         show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="Examinationmethods" :label="TrainingPlanManagement.Examinationmethods"
                         min-width="80" show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column prop="Trainers" :label="TrainingPlanManagement.Trainers" min-width="80"
                         show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column width="53" :label="col.btnUpdate" fixed="right">
            <template slot-scope="scope">
                <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)>
                    <i class="el-icon-edit"></i>
                </button>
            </template>
        </el-table-column>-->


         </el-table>

        <!--<el-row type="flex" justify="end">
        <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                       :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes" :page-size="ListItem.pagesize"
                       :layout="ListItem.layout" :total="ListItem.total">
        </el-pagination>
        </el-row>-->

                <el-row type="flex" justify="end">
                    <el-form-item>
                        <br />
                        <!--<el-button type="primary" @click="onSubmitForm('ruleForm')">生成培训计划</el-button>-->
                        <!--<el-button type="primary" @click="parent.ListItem.dialogVisible=false">生成培训计划</el-button>-->
                        <el-button type="primary" @click="FileAudit('sp')">生成培训计划</el-button>
                    </el-form-item>
                </el-row>
            </el-col>

        </el-form>

        <el-dialog title="培训计划管理" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="90%"
                   height="90%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>

        


    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                multipleSelection: [],
                ListItem: ListItem,
                value1: '',
                planYear: '',
                TrainingMatrix: [],
                checked: true,
                isShow: true,
                formInline: {
                    value1: '',
                    // 遍历所有列 均为字符串即可
                    model: {
                        Name: '', Category: '', Teacher: '', LlearningTime: '', Courseware: '', IsEncrypted: '', TrainingtimeStar: '', TrainingtimeEnd: ''
                    },
                    offset: 0,
                    limit: 10
                }
            },
            mounted: function () {

                console.log(getDicDataArray(["01", "02", "03", "04"]))

                //获取下拉菜单内容
                this.TrainingMatrix = getDicData('n93');


                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
                this.getYear();
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //评审实现
                FileAudit: function (bz) {
                    if (this.multipleSelection.length == 0) {
                        alert("请选择数据！");
                    }
                    else {


                        var sid = "";
                        var spost = "";
                        var strainingcourse = "";

                        var j = 0;
                        for (var i = 0; i < this.multipleSelection.length; i++) {
                            sid = this.multipleSelection[i].id;
                            spost = this.multipleSelection[i].post;
                            strainingcourse = this.multipleSelection[i].trainingcourse;

                            parent.$TrainingPlanManagement.Arrays.unshift({
                                id: sid,
                                post: spost, //岗位
                                trainingcourse: strainingcourse, //培训课程

                            });
                        }
                            
                       
                        parent.ListItem.dialogVisible = false;
                    }
                    //console.log(a);
                },

                //动态获取年份
                getYear: function () {
                    var date = new Date;
                    var y = date.getFullYear();
                    this.planYear = y + 1
                },
                btnSendnotifications: function () {
                    this.$message({
                        showClose: true,
                        message: '通知发送成功',
                        type: 'success'
                    });
                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                closeDialog: function () { closeDialog(this); },
                //Model 替换成 表名
                onDelete: function () { onDelete(this, '/api/TrainingPlanManagement/DeleteMuti'); },
               
                //列表选择触发
                //handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                handleSelectionChange: function (val) {
                    this.multipleSelection = val;
                },


                //Model 替换成 表名
                UserInput: function (val, id) { DialogShow(this, val, "TrainingPlanManagementTrainingPlanGenerationListInput.html", id); },
                UserInputStatistics: function (val, id) { DialogShow(this, val, "TrainingPlanManagementluruInput.html", id); },
                trainingPlanGeneration: function (val, id) { DialogShow(this, val, "TrainingPlanManagementTrainingPlanGenerationList.html", id); },
                //Model 替换成 表名
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/TrainingPlanManagement/GetList') },

                onSubmit: function () { onSubmit(this); },

                handleSizeChange: function (val) { handleSizeChange(this, val); },

                handleCurrentChange: function (val) { handleCurrentChange(this, val); },

                handleNodeClick: function (data) {
                    this.formInline.model.Category = data.id;
                    this.GetPageData(1);
                }
            }
        });
    </script>

</body>

</html>